#region Header Licence
//  NKnobMan, Copyright 2009, Alexandre MUTEL.
// 
//  This is free software; you can redistribute it and/or modify it
//  under the terms of the GNU Lesser General Public License as
//  published by the Free Software Foundation; either version 2.1 of
//  the License, or (at your option) any later version.
// 
//  This software is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
//  Lesser General Public License for more details.
// 
//  You should have received a copy of the GNU Lesser General Public
//  License along with this software; if not, write to the Free
//  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
//  02110-1301 USA, or see the FSF site: http://www.fsf.org.
#endregion
using System.Runtime.Serialization;

namespace NKnobMan
{

    [DataContract]
    public class LayerMask : LayerItem
    {
        public LayerMask(Layer layer) : base(layer)
        {
        }

        [DataMember, KnobManField("MaskStart")]
        public FloatAnimateLayerItem Start { get; private set; }

        [DataMember, KnobManField("MaskStop")]
        public FloatAnimateLayerItem Stop { get; private set; }

        [DataMember, KnobManField]
        public bool UseMask
        {
            get { return Layer.GetValue<bool>("UseMask"); }
            set { Layer.SetValue("UseMask",value); }            
        }

        [DataMember, KnobManField("MaskType")]
        public string Type
        {
            get { return Layer.GetValue<string>("MaskType"); }
            set { Layer.SetValue("MaskType", value); }            
        }

        [DataMember, KnobManField( "MaskGradation")]
        public int Gradation
        {
            get { return Layer.GetValue<int>( "MaskGradation"); }
            set { Layer.SetValue( "MaskGradation", value); }            
        }

        [DataMember, KnobManField("MaskGradDir")]
        public string Direction
        {
            get { return Layer.GetValue<string>("MaskGradDir"); }
            set { Layer.SetValue("MaskGradDir", value); }            
        }

        [DataMember, KnobManField("UseFMask")]
        public bool FrameMask
        {
            get { return Layer.GetValue<bool>("UseFMask"); }
            set { Layer.SetValue("UseFMask",value); }
        }

        [DataMember, KnobManField("FMaskStart")]
        public float FrameMaskStart
        {
            get { return Layer.GetValue<float>("FMaskStart"); }
            set { Layer.SetValue("FMaskStart", value); }
        }

        [DataMember, KnobManField("FMaskStop")]
        public float FrameMaskStop
        {
            get { return Layer.GetValue<float>("FMaskStop"); }
            set { Layer.SetValue("FMaskStop", value); }
        }
    }
}